package com.gemantic.task.job;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.gemantic.task.dto.DbTaskJobParams;
import com.gemantic.task.service.TaskService;
import com.xxl.job.core.handler.annotation.XxlJob;


@Service
public class MqTaskJobHandler extends BaseJobHandler<DbTaskJobParams> {
    @Autowired
    private TaskService taskService;

    @Override
    @XxlJob("MqTaskJob")
    public void process(DbTaskJobParams paramDto) throws Exception {
        if (paramDto == null) {
            return;
        }
        taskService.runFromMq(paramDto);
    }
}